/*******************************************************************************
 * Copyright (c) 2006 CEA List.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     CEA List - initial API and implementation
 *******************************************************************************/
package com.cea.papyrus.diagram.usecase.editpart;

import org.eclipse.draw2d.IFigure;
import org.eclipse.uml2.uml.Include;

import com.cea.papyrus.core.editor.ModelManager;
import com.cea.papyrus.core.editpart.connection.NamedGraphEdgeEditPart;
import com.cea.papyrus.core.figures.connection.DashEdgeFigure;
import com.cea.papyrus.diagraminterchange2.di2.GraphEdge;
import com.cea.papyrus.diagraminterchange2.di2.Uml1SemanticModelBridge;

/**
 * Controller for an {@link Include}.
 */
public class IncludeEditPart extends NamedGraphEdgeEditPart {

	/**
	 * Creates a new IncludeEditPart
	 * @param graphEdge the graph edge representing the include.
	 * @param modelManager the model manager associated to the editor
	 */
	public IncludeEditPart(GraphEdge graphEdge, ModelManager modelManager) {
		super(graphEdge, modelManager);
	}
	
	/* (non-Javadoc)
	 * @see com.cea.papyrus.common.editpart.GraphEdgeEditPart#getUmlElement()
	 */
	@Override
	public Include getUmlElement() {
		return (Include) ((Uml1SemanticModelBridge) (getGraphEdge()).getSemanticModel()).getElement();
	}

	/* (non-Javadoc)
	 * @see com.cea.papyrus.common.editpart.edge.StereotypedGraphEdgeEditPart#createFigure()
	 */
	@Override
	protected IFigure createFigure() {
		return new DashEdgeFigure();
	}
}